<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>Document</title>
        <script>!function(t,e){var n=t.documentElement,i="orientationchange"in window?"orientationchange":"resize",o=function(){var t=n.clientWidth,e=750;t&&(t>=e?n.style.fontSize="100px":n.style.fontSize=100*(t/e)+"px")};o(),t.addEventListener&&(e.addEventListener(i,o,!1),t.addEventListener("DOMContentLoaded",o,!1))}(document,window);</script>
        <link rel="stylesheet" href="../css/base.css" />
        <link rel="stylesheet" href="../css/common.css" />
    </head>
    <body>
        <h1>小tips: touch-action简介与treated as passive错误解决</h1>
        <p><a href="https://www.zhangxinxu.com/wordpress/2018/07/chrome-safari-touchmove-preventdefault-treated-as-passive/">来源</a></p>
        <script>
            $listContainer.get(0).addEventListener('scroll', function(e) {
                // e.preventDefault();
                if (!enableGetList) {
                    return;
                }
                var scrollHeight = $listContainer.get(0).scrollHeight;
                var scrollTop = $listContainer.scrollTop();
                var height = $listContainer.height();
                // console.log("scrollHeight", scrollHeight, "scrollTop", scrollTop);
                if (scrollHeight - scrollTop - height < 200) {
                    scope.getWinnerListData(page);
                }
            }, scope.compatiblePassive() ? {
                passive: true
            } : false)
            function compatiblePassive () {
                // Test via a getter in the options object to see 
                // if the passive property is accessed
                var supportsPassive = false;
                try {
                    var opts = Object.defineProperty({}, 'passive', {
                        get: function() {
                            supportsPassive = true;
                        }
                    });
                    window.addEventListener("test", null, opts);
                } catch ( e ) {}
                return supportsPassive;
            },
        </script>
    </body>
</html>